export function menuToCrumbs(path: string, menuList: any[]) {
  const crumbs: any[] = []
  for (const menu of menuList) {
    if (menu.children.length > 0) {
      for (const subMenu of menu.children) {
        if ('/' + subMenu.path === path) {
          crumbs.push({ name: menu.menuName, path: menu.path })
          crumbs.push({ name: subMenu.menuName, path: subMenu.path })
        }
      }
    } else {
      if ('/' + menu.path === path) {
        crumbs.push({ name: menu.menuName, path: menu.path })
      }
    }
  }
  return crumbs
}
